﻿using HenuAlbum.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HenuAlbum.ControllerModels
{
    public class ResourceOperatorResult
    {
        public Guid ResourceId { get; set; }
        public AlbumInfo albumInfo { get; set; }
        public String Title { get; set; }
        public String Description { get; set; }
        public DateTime CreateTime { get; set; }
        public ResourceType Type { get; set; }
        public List<ResourceTag> Tags { get; set; }

        public int VisitorCount { get; set; }
        public UploaderOperatorResult Uploader { get; set; }
        public ResourceOperatorResult(Resource resource,int visitorCount)
        {
            ResourceId = resource.Id;
            albumInfo = new AlbumInfo(resource);
            Title = resource.Title;
            Description = resource.Description;
            CreateTime = resource.CreateTime;
            Type = resource.Type;
            Tags = resource.Tags;
            VisitorCount = visitorCount;
            Uploader = new UploaderOperatorResult(resource.Uploader);
        }

    }
}
